<template>
	<view class="page" style="padding-bottom: 50rpx;">
		<view class="topVue">
			<view class="safeVue" :style="{ height: statusBarHeight + 'rpx' }"></view>
			<view class="flex align-center padding-row30" :style="{ height: barHeight + 'rpx', top: statusBarHeight + 'rpx' }" @click="$tools.back()">
				<image src="../../static/back.png" style="width: 48rpx; height: 48rpx;"></image>
				<text style="line-height: 1; color: #454545; font-weight: 600; font-size: 32rpx; padding-left: 20rpx;">兑换记录</text>
			</view>
		</view>
		<view :style="{ height: statusBarHeight + barHeight + 'rpx' }"></view>
		
		
		<view class="item margin20 flex-column flex-between padding30 relative" v-for="(item,idex) in list" :key="index">
			<text>提现人：{{item.name}}</text>
			<text>手机号：{{item.phone}}</text>
			<text>提现数量：{{item.pointNum}}</text>
			<text>提现时间：{{item.createTime}}</text>
			<view class="state absolute">{{["审核中", "已通过", "未通过"][item.status]}}</view>
		</view>
	
	</view>
</template>

<script>
	
	export default {
		data(){
			return {
				statusBarHeight: 0,
				barHeight: 0,
				list: []
			}
		},
		
	
		onLoad() {
			let that = this;
			wx.getSystemInfo({
				success(res) {
					let deviceWidth = wx.getSystemInfoSync().windowWidth
					that.statusBarHeight = Number(res.statusBarHeight) * ( 750 / deviceWidth ) 
					let menuButtonInfo = wx.getMenuButtonBoundingClientRect()
					let barHeight = menuButtonInfo.height + (menuButtonInfo.top - res.statusBarHeight) * 2
					that.barHeight = Number(barHeight) * ( 750 / deviceWidth )
				},
			});
		},
		async onShow(){
			const res = await this.$request("/api/WeChat/withdrawRedPacketList", {},"GET")
			if(res.code===200){
				this.list = res.data
			}
		},
		
		
		methods: {
			
		}
	}
</script>

<style lang="less" scoped>
	.item {
		width: 690rpx;
		height: 240rpx;
		border: 1rpx solid #f5f5f5;
		border-radius: 20rpx;
		.state {
			width: 100rpx;
			height: 56rpx;
			background: #D37430;
			border-radius: 0 20rpx 0 0;
			top: 0;
			right: 0;
			color: #fff;
			text-align: center;
			line-height: 56rpx;
		}
	}
	.topVue {
		width: 100%;
		background: #fff;
		position: fixed;
		left: 0;
		top: 0;
		z-index: 99;
		.safeVue {
			width: 100%;
		}
	}
	

</style>